<!DOCTYPE html>
<html   xmlns="http://www.w3c.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head />
    <h:body>
        <p:rating value="#{ratingBean.rating}" stars="10" />
        <br />
        <p:rating value="#{ratingBean.rating}">
            <p:ajax event="rate" listener="#{ratingBean.handleRate}" update="msgs" />
            <p:ajax event="cancel" listener="#{ratingBean.handleCancel}" update="msgs" />
        </p:rating>
        <p:messages id="msgs" />
        <br />
        <p:rating value="#{ratingBean.rating}" onRate="alert('You rated: ' + value)" />
    </h:body>
</html>
